/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("materialfactoryplan",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using ATkg.BizAppProject.DomainModels;
using ATkg.BizAppProject.IServices;
using Microsoft.AspNetCore.Authorization;

namespace ATkg.BizAppProject.Controllers
{
    public partial class materialfactoryplanController
    {
        private readonly ImaterialfactoryplanService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public materialfactoryplanController(
            ImaterialfactoryplanService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }

        [HttpGet("get_cailiao_plan")]
        [AllowAnonymous]
        //[HttpBody]
        public async Task<object> get_cailiao_plan()
        //public async Task<JsonResult> SyncProductionTask_wgjy([FromBody] PageDataOptions order_no_)

        {

            Console.WriteLine("get方法调用");
            var result = await Service.get_cailiao_gdplan();
            var r = "1111";
            return result;
        }

        [HttpGet("get_cailiao_plan_data5")]
        [AllowAnonymous]
        //[HttpBody]
        public async Task<object> get_cailiao_plan_data5()
        //public async Task<JsonResult> SyncProductionTask_wgjy([FromBody] PageDataOptions order_no_)

        {

            Console.WriteLine("get方法调用");
            var result = await Service.get_cailiao_plan_data();
            var r = "1111";
            return result;
        }

        [HttpGet("get_db_data_plan")]
        [AllowAnonymous]
        //[HttpBody]
        public async Task<object> get_db_data_plan()
        //public async Task<JsonResult> SyncProductionTask_wgjy([FromBody] PageDataOptions order_no_)

        {

            Console.WriteLine("get方法调用");
            var result = await Service.get_cailiao_plan_data_from_db();
            var r = "1111";
            return result;
        }

    }
}
